{	Problem: http://codeforces.ru/problemset/problem/110/C
	Verdict: Accepted
}
uses
    SysUtils, Math;

var
    i, n, x, y : longint; 
    a : array[0..1000010, 1..2] of longint;

function count(i : longint) : longint;
begin
    count := a[i][1] + a[i][2];
end;

begin 
    read(n);
    fillchar(a, sizeof(a), 0);
    a[4][1] := 1;
    a[4][2] := 0;
    a[7][1] := 0;
    a[7][2] := 1;
    for i := 8 to n do begin 
        x := count(i - 7);
        y := count(i - 4);
        if (x > 0) and (y > 0) then begin
            if x < y then begin
                a[i][1] := a[i - 7][1];
                a[i][2] := a[i - 7][2] + 1;
            end else begin
                a[i][1] := a[i - 4][1] + 1;
                a[i][2] := a[i - 4][2];
            end;
        end else
        if x > 0 then begin
            a[i][1] := a[i - 7][1];
            a[i][2] := a[i - 7][2] + 1;
        end else
        if y > 0 then begin
            a[i][1] := a[i - 4][1] + 1;
            a[i][2] := a[i - 4][2];
        end;
    end;
    if count(n) = 0 then write(-1) else begin
        for i := 1 to a[n][1] do
            write(4);
        for i := 1 to a[n][2] do
            write(7);
    end;
end.